package com.example.projectmgmt.model;

import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class MilestoneId implements Serializable {
    @Column(name = "project_no", length = 10)
    private String projectNo;

    @Column(name = "phrase_id", length = 10)
    private String phraseId;

    @Column(name = "milestone_id", length = 10)
    private String milestoneId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MilestoneId that = (MilestoneId) o;
        return Objects.equals(projectNo, that.projectNo) &&
                Objects.equals(phraseId, that.phraseId) &&
                Objects.equals(milestoneId, that.milestoneId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(projectNo, phraseId, milestoneId);
    }

    // Getters and Setters
    public String getProjectNo() { return projectNo; }
    public void setProjectNo(String projectNo) { this.projectNo = projectNo; }
    public String getPhraseId() { return phraseId; }
    public void setPhraseId(String phraseId) { this.phraseId = phraseId; }
    public String getMilestoneId() { return milestoneId; }
    public void setMilestoneId(String milestoneId) { this.milestoneId = milestoneId; }
}